﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ByHand.Data;
using ByHand.Data.Interfaces;
using ByHand.Model;
using ByHand.Services.Interfaces;

namespace ByHand.Services.Implements
{
    public class CityService : RepositoryBase<City>, ICityService
    {
        public CityService(IDatabaseFactory dbFactory) : base(dbFactory) { }
        public bool IsExist(string name) {
            var city = (from c in ByHandDB.Cities
                        where c.Name.ToLower().Equals(name.ToLower())
                        select c).FirstOrDefault();
            return city != null;
        }
    }
}
